package com.acxy.service.system;

import com.acxy.ants.common.enums.DataSourceType;
import com.acxy.ants.common.kit.JsonMap;
import com.acxy.ants.core.annotation.Service;
import com.acxy.ants.core.annotation.Source;
import com.acxy.ants.core.annotation.Tx;
import com.acxy.ants.core.exception.TipException;
import com.acxy.ants.core.plugin.db.Db;
import com.alibaba.fastjson.JSON;

import java.util.HashMap;
import java.util.Map;

/**
 * @author MrShun
 * @version 1.0
 * @Date 2017-10-27
 */
@Service
public class TestServiceImpl implements TestService {

    @Source(DataSourceType.DRUID)
    private Db db;

    @Source(name = "db2", value = DataSourceType.DRUID)
    private Db db2;

    @Override
    public String sayHello(){
        JsonMap query = db2.query("select * from heart limit 1");
        System.err.println(query);
        JsonMap query2 = db.query("select * from article where id=15");
        System.err.println(query2);
        return "ok";
    }
}
